-
Notifications
You must be signed in to change notification settings - Fork 352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(//core/converters): Add normalization plugin #323
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some changes that do not conform to C++ style guidelines:
diff --git a/workspace/tests/core/conversion/converters/test_element_wise.cpp b/tmp/changes.txt
index 4b2fe9c..5431e9a 100644
--- a/workspace/tests/core/conversion/converters/test_element_wise.cpp
+++ b/tmp/changes.txt
@@ -172,117 +172,117 @@ TEST(Converters, ATenNeScalarConvertsCorrectly) {
pointwise_test_helper(graph, true, false, {3, 4, 2});
;
-TEST(Converters, ATenClampMinConvertsCorrectly) {
- const auto graph = R"IR(
+ TEST(Converters, ATenClampMinConvertsCorrectly) {
+ const auto graph = R"IR(
graph(%x.1 : Tensor):
%2 : int = prim::Constant[value=-2]()
%3 : None = prim::Constant()
%4 : Tensor = aten::clamp(%x.1, %2, %3)
return (%4))IR";
- pointwise_test_helper(graph, true);
-}
+ pointwise_test_helper(graph, true);
+ }
-TEST(Converters, ATenClampMaxConvertsCorrectly) {
- const auto graph = R"IR(
+ TEST(Converters, ATenClampMaxConvertsCorrectly) {
+ const auto graph = R"IR(
graph(%x.1 : Tensor):
%2 : int = prim::Constant[value=3]()
%3 : None = prim::Constant()
%4 : Tensor = aten::clamp(%x.1, %3, %2)
return (%4))IR";
- pointwise_test_helper(graph, true);
-}
+ pointwise_test_helper(graph, true);
+ }
-TEST(Converters, ATenClampMinMaxConvertsCorrectly) {
- const auto graph = R"IR(
+ TEST(Converters, ATenClampMinMaxConvertsCorrectly) {
+ const auto graph = R"IR(
graph(%x.1 : Tensor):
%2 : int = prim::Constant[value=3]()
%3 : int = prim::Constant[value=-2]()
%4 : Tensor = aten::clamp(%x.1, %3, %2)
return (%4))IR";
- pointwise_test_helper(graph, true);
-}
+ pointwise_test_helper(graph, true);
+ }
-TEST(Converters, ATenGreaterThanConvertsCorrectly) {
- const auto graph = R"IR(
+ TEST(Converters, ATenGreaterThanConvertsCorrectly) {
+ const auto graph = R"IR(
graph(%0 : Tensor, %1 : Tensor):
%2 : Tensor = aten::gt(%0, %1)
return (%2))IR";
- pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
-}
+ pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
+ }
-TEST(Converters, ATenGreaterThanScalarConvertsCorrectly) {
- const auto graph = R"IR(
+ TEST(Converters, ATenGreaterThanScalarConvertsCorrectly) {
+ const auto graph = R"IR(
graph(%0 : Tensor):
%scalar : float = prim::Constant[value=3]()
%2 : Tensor = aten::gt(%0, %scalar)
return (%2))IR";
- pointwise_test_helper(graph, true, false, {5, 5});
-}
+ pointwise_test_helper(graph, true, false, {5, 5});
+ }
-TEST(Converters, ATenLessThanConvertsCorrectly) {
- const auto graph = R"IR(
+ TEST(Converters, ATenLessThanConvertsCorrectly) {
+ const auto graph = R"IR(
graph(%0 : Tensor, %1 : Tensor):
%2 : Tensor = aten::lt(%0, %1)
return (%2))IR";
- pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
-}
+ pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
+ }
-TEST(Converters, ATenLessThanScalarConvertsCorrectly) {
- const auto graph = R"IR(
+ TEST(Converters, ATenLessThanScalarConvertsCorrectly) {
+ const auto graph = R"IR(
graph(%0 : Tensor):
%scalar : float = prim::Constant[value=3]()
%2 : Tensor = aten::lt(%0, %scalar)
return (%2))IR";
- pointwise_test_helper(graph, true, false, {5, 5});
-}
+ pointwise_test_helper(graph, true, false, {5, 5});
+ }
-TEST(Converters, ATenEqualConvertsCorrectly) {
- const auto graph = R"IR(
+ TEST(Converters, ATenEqualConvertsCorrectly) {
+ const auto graph = R"IR(
graph(%0 : Tensor, %1 : Tensor):
%2 : Tensor = aten::eq(%0, %1)
return (%2))IR";
- pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
-}
+ pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
+ }
-TEST(Converters, ATenEqualScalarConvertsCorrectly) {
- const auto graph = R"IR(
+ TEST(Converters, ATenEqualScalarConvertsCorrectly) {
+ const auto graph = R"IR(
graph(%0 : Tensor):
%scalar : float = prim::Constant[value=3]()
%2 : Tensor = aten::eq(%0, %scalar)
return (%2))IR";
- pointwise_test_helper(graph, true, false, {5, 5});
-}
+ pointwise_test_helper(graph, true, false, {5, 5});
+ }
-TEST(Converters, ATenGEConvertsCorrectly) {
- const auto graph = R"IR(
+ TEST(Converters, ATenGEConvertsCorrectly) {
+ const auto graph = R"IR(
graph(%0 : Tensor, %1 : Tensor):
%2 : Tensor = aten::ge(%0, %1)
return (%2))IR";
- pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
-}
+ pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
+ }
-TEST(Converters, ATenGEScalarConvertsCorrectly) {
- const auto graph = R"IR(
+ TEST(Converters, ATenGEScalarConvertsCorrectly) {
+ const auto graph = R"IR(
graph(%0 : Tensor):
%scalar : float = prim::Constant[value=3]()
%2 : Tensor = aten::ge(%0, %scalar)
return (%2))IR";
- pointwise_test_helper(graph, true, false, {5, 5});
-}
+ pointwise_test_helper(graph, true, false, {5, 5});
+ }
-TEST(Converters, ATenLEConvertsCorrectly) {
- const auto graph = R"IR(
+ TEST(Converters, ATenLEConvertsCorrectly) {
+ const auto graph = R"IR(
graph(%0 : Tensor, %1 : Tensor):
%2 : Tensor = aten::le(%0, %1)
return (%2))IR";
- pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
-}
+ pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
+ }
-TEST(Converters, ATenLEScalarConvertsCorrectly) {
- const auto graph = R"IR(
+ TEST(Converters, ATenLEScalarConvertsCorrectly) {
+ const auto graph = R"IR(
graph(%0 : Tensor):
%scalar : float = prim::Constant[value=3]()
%2 : Tensor = aten::le(%0, %scalar)
return (%2))IR";
- pointwise_test_helper(graph, true, false, {5, 5});
-}
+ pointwise_test_helper(graph, true, false, {5, 5});
+ }
ERROR: Some files do not conform to style guidelines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some changes that do not conform to C++ style guidelines:
diff --git a/workspace/tests/core/conversion/converters/test_element_wise.cpp b/tmp/changes.txt
index 4b2fe9c..5431e9a 100644
--- a/workspace/tests/core/conversion/converters/test_element_wise.cpp
+++ b/tmp/changes.txt
@@ -172,117 +172,117 @@ TEST(Converters, ATenNeScalarConvertsCorrectly) {
pointwise_test_helper(graph, true, false, {3, 4, 2});
;
-TEST(Converters, ATenClampMinConvertsCorrectly) {
- const auto graph = R"IR(
+ TEST(Converters, ATenClampMinConvertsCorrectly) {
+ const auto graph = R"IR(
graph(%x.1 : Tensor):
%2 : int = prim::Constant[value=-2]()
%3 : None = prim::Constant()
%4 : Tensor = aten::clamp(%x.1, %2, %3)
return (%4))IR";
- pointwise_test_helper(graph, true);
-}
+ pointwise_test_helper(graph, true);
+ }
-TEST(Converters, ATenClampMaxConvertsCorrectly) {
- const auto graph = R"IR(
+ TEST(Converters, ATenClampMaxConvertsCorrectly) {
+ const auto graph = R"IR(
graph(%x.1 : Tensor):
%2 : int = prim::Constant[value=3]()
%3 : None = prim::Constant()
%4 : Tensor = aten::clamp(%x.1, %3, %2)
return (%4))IR";
- pointwise_test_helper(graph, true);
-}
+ pointwise_test_helper(graph, true);
+ }
-TEST(Converters, ATenClampMinMaxConvertsCorrectly) {
- const auto graph = R"IR(
+ TEST(Converters, ATenClampMinMaxConvertsCorrectly) {
+ const auto graph = R"IR(
graph(%x.1 : Tensor):
%2 : int = prim::Constant[value=3]()
%3 : int = prim::Constant[value=-2]()
%4 : Tensor = aten::clamp(%x.1, %3, %2)
return (%4))IR";
- pointwise_test_helper(graph, true);
-}
+ pointwise_test_helper(graph, true);
+ }
-TEST(Converters, ATenGreaterThanConvertsCorrectly) {
- const auto graph = R"IR(
+ TEST(Converters, ATenGreaterThanConvertsCorrectly) {
+ const auto graph = R"IR(
graph(%0 : Tensor, %1 : Tensor):
%2 : Tensor = aten::gt(%0, %1)
return (%2))IR";
- pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
-}
+ pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
+ }
-TEST(Converters, ATenGreaterThanScalarConvertsCorrectly) {
- const auto graph = R"IR(
+ TEST(Converters, ATenGreaterThanScalarConvertsCorrectly) {
+ const auto graph = R"IR(
graph(%0 : Tensor):
%scalar : float = prim::Constant[value=3]()
%2 : Tensor = aten::gt(%0, %scalar)
return (%2))IR";
- pointwise_test_helper(graph, true, false, {5, 5});
-}
+ pointwise_test_helper(graph, true, false, {5, 5});
+ }
-TEST(Converters, ATenLessThanConvertsCorrectly) {
- const auto graph = R"IR(
+ TEST(Converters, ATenLessThanConvertsCorrectly) {
+ const auto graph = R"IR(
graph(%0 : Tensor, %1 : Tensor):
%2 : Tensor = aten::lt(%0, %1)
return (%2))IR";
- pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
-}
+ pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
+ }
-TEST(Converters, ATenLessThanScalarConvertsCorrectly) {
- const auto graph = R"IR(
+ TEST(Converters, ATenLessThanScalarConvertsCorrectly) {
+ const auto graph = R"IR(
graph(%0 : Tensor):
%scalar : float = prim::Constant[value=3]()
%2 : Tensor = aten::lt(%0, %scalar)
return (%2))IR";
- pointwise_test_helper(graph, true, false, {5, 5});
-}
+ pointwise_test_helper(graph, true, false, {5, 5});
+ }
-TEST(Converters, ATenEqualConvertsCorrectly) {
- const auto graph = R"IR(
+ TEST(Converters, ATenEqualConvertsCorrectly) {
+ const auto graph = R"IR(
graph(%0 : Tensor, %1 : Tensor):
%2 : Tensor = aten::eq(%0, %1)
return (%2))IR";
- pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
-}
+ pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
+ }
-TEST(Converters, ATenEqualScalarConvertsCorrectly) {
- const auto graph = R"IR(
+ TEST(Converters, ATenEqualScalarConvertsCorrectly) {
+ const auto graph = R"IR(
graph(%0 : Tensor):
%scalar : float = prim::Constant[value=3]()
%2 : Tensor = aten::eq(%0, %scalar)
return (%2))IR";
- pointwise_test_helper(graph, true, false, {5, 5});
-}
+ pointwise_test_helper(graph, true, false, {5, 5});
+ }
-TEST(Converters, ATenGEConvertsCorrectly) {
- const auto graph = R"IR(
+ TEST(Converters, ATenGEConvertsCorrectly) {
+ const auto graph = R"IR(
graph(%0 : Tensor, %1 : Tensor):
%2 : Tensor = aten::ge(%0, %1)
return (%2))IR";
- pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
-}
+ pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
+ }
-TEST(Converters, ATenGEScalarConvertsCorrectly) {
- const auto graph = R"IR(
+ TEST(Converters, ATenGEScalarConvertsCorrectly) {
+ const auto graph = R"IR(
graph(%0 : Tensor):
%scalar : float = prim::Constant[value=3]()
%2 : Tensor = aten::ge(%0, %scalar)
return (%2))IR";
- pointwise_test_helper(graph, true, false, {5, 5});
-}
+ pointwise_test_helper(graph, true, false, {5, 5});
+ }
-TEST(Converters, ATenLEConvertsCorrectly) {
- const auto graph = R"IR(
+ TEST(Converters, ATenLEConvertsCorrectly) {
+ const auto graph = R"IR(
graph(%0 : Tensor, %1 : Tensor):
%2 : Tensor = aten::le(%0, %1)
return (%2))IR";
- pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
-}
+ pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
+ }
-TEST(Converters, ATenLEScalarConvertsCorrectly) {
- const auto graph = R"IR(
+ TEST(Converters, ATenLEScalarConvertsCorrectly) {
+ const auto graph = R"IR(
graph(%0 : Tensor):
%scalar : float = prim::Constant[value=3]()
%2 : Tensor = aten::le(%0, %scalar)
return (%2))IR";
- pointwise_test_helper(graph, true, false, {5, 5});
-}
+ pointwise_test_helper(graph, true, false, {5, 5});
+ }
ERROR: Some files do not conform to style guidelines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code conforms to Python style guidelines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code conforms to Python style guidelines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code conforms to C++ style guidelines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code conforms to Python style guidelines
handled in #425 |
Description
Add normalization plugin. This plugin currently uses pytorch aten library kernels.
Fixes #280
Type of change
Checklist: